package cn.bandeqing.workTime.entity;

import cn.bandeqing.dispatch.req.ModifyWorkTimeSwitchReq;
import cn.bandeqing.dispatch.req.WorkTimeSaveOrUpdateReq;
import cn.bandeqing.frame.mybatis.config.InsertOrUpdateListener;
import cn.bandeqing.frame.mybatis.entity.BaseEntity;
import cn.bandeqing.workTime.req.WorkTimeModifyReq;
import cn.bandeqing.workTime.resp.WorkTimeList;
import com.mybatisflex.annotation.Id;
import com.mybatisflex.annotation.KeyType;
import com.mybatisflex.annotation.Table;
import io.github.linpeilie.annotations.AutoMapper;
import io.github.linpeilie.annotations.AutoMappers;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.sql.Date;

/**
 * 工作人员日程表 实体类。
 *
 * @author fugui
 * @since 2024-01-09
 */
@EqualsAndHashCode(callSuper = true)
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@Table(value = "bdq_work_time", onInsert = InsertOrUpdateListener.class, onUpdate = InsertOrUpdateListener.class)
@AutoMappers({
        @AutoMapper(target = WorkTimeList.class, reverseConvertGenerate = false),
        @AutoMapper(target = WorkTimeSaveOrUpdateReq.class, convertGenerate = false),
        @AutoMapper(target = WorkTimeModifyReq.class, convertGenerate = false),
        @AutoMapper(target = ModifyWorkTimeSwitchReq.class, convertGenerate = false),
})
public class WorkTime extends BaseEntity {

    @Id(keyType = KeyType.Auto)
    private Long wtId;

    /**
     * 工作人员ID
     */
    private Long workerId;
    private String workerName;

    /**
     * 上午 7-12
     */
    private Boolean morning;

    /**
     * 12-18
     */
    private Boolean noon;

    /**
     * >18 || <7
     */
    private Boolean afternoon;

    /**
     * 日期
     */
    private Date wtDate;

}
